UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tdaWadbCXPSZQ7GlNBRAlOPOOWOCYNTSmjqKWFNaJ8o='
WHERE
key_id = '7067e5fe9f5fbc8348d11ebef4344e0cb7c5f6f391f23ace413f5b3050d23f6a'
AND (
token = 'tdaWadbCXPSZQ7GlNBRAlOPOOWOCYNTSmjqKWFNaJ8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)