UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2R5KnJdBkf9ryjQPmXoDeQeZq54v+NMK5bqYxpRxVIY='
WHERE
key_id = 'd4f4a61a696b22a497ea3947ecefd91f1f20968ceae7c48b8fc828126cdf4952'
AND (
token = '2R5KnJdBkf9ryjQPmXoDeQeZq54v+NMK5bqYxpRxVIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)