UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yiq20TDmRe2GCEvo7bj7py2hhuWi9L+eCO9HVThFdMI='
WHERE
key_id = 'c9b409e5ed97ff4307e0aacea45311f6905d50392bb38102473fb8af940be70d'
AND (
token = 'Yiq20TDmRe2GCEvo7bj7py2hhuWi9L+eCO9HVThFdMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)