UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PYy6cNps4aRAErsmbhBtij7CONjZBXWHgbiErQ2JZJM='
WHERE
key_id = '37902760ea44172b1207961fee33914c7415014cde9e560a6ece8e121ae54e46'
AND (
token = 'PYy6cNps4aRAErsmbhBtij7CONjZBXWHgbiErQ2JZJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)