UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2G2cmL2TM9KkhlNnzCxrmXNj6T72UPNiV2XPXI7Tv6o='
WHERE
key_id = '569e870041409ddfbf6b3e13af6eb4b53e8e09ffcc0c59612db2b18b2b31982a'
AND (
token = '2G2cmL2TM9KkhlNnzCxrmXNj6T72UPNiV2XPXI7Tv6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)