UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3guDCxEDOeR+mSeAei7T0PNpSvLsZGaDTPMHIDQQPn0='
WHERE
key_id = '8fa457c35fca0c4a73e2758004d51076ed41e6bb1079b230f76b7c793ed1146d'
AND (
token = '3guDCxEDOeR+mSeAei7T0PNpSvLsZGaDTPMHIDQQPn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)