UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q/JIKV0tCJZV9PKLu6Ex4mdwDH1c2yqmXsqbYw5Vw/I='
WHERE
key_id = '9d10c84e5e4cb3708f0b2df65638afff6b4c15f3f9b89f8fba00abfbda519de4'
AND (
token = 'Q/JIKV0tCJZV9PKLu6Ex4mdwDH1c2yqmXsqbYw5Vw/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)