UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MXaanQk1cbVt8p3cv6gAIHcjw/BztVxWJcTB4lPSzAE='
WHERE
key_id = '5be9e0af798031122058208f2a59eb094a4e43034c8ff8d1ac1fb51e9b17dad9'
AND (
token = 'MXaanQk1cbVt8p3cv6gAIHcjw/BztVxWJcTB4lPSzAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)