UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'prI/wmbjZTvrhgtVbKcuvT6NC4LjZaf+bMXRBbirt2s='
WHERE
key_id = 'eca796dc9b4c0d98b1ba6e398ddbcc912150d5c674a2bac338cc8c1b10a6afb1'
AND (
token = 'prI/wmbjZTvrhgtVbKcuvT6NC4LjZaf+bMXRBbirt2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)