UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TlI9GfUYeSkR6yYntVjGyJjq6tsfYOZtBciHqxCVdAM='
WHERE
key_id = '82802793819fb41382410b5c7c4b4a9eacdcbdffe88ab8d8fd050c8c9fecfbb2'
AND (
token = 'TlI9GfUYeSkR6yYntVjGyJjq6tsfYOZtBciHqxCVdAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)