UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FQI326oZFsNBfWFI3TuncVaMd9n5d7rBtvztTS8NEOw='
WHERE
key_id = 'c322aaaceb9fe5a5d2b636d683d85c80c88fea654e2c9dd506ad7fb9c12c3c51'
AND (
token = 'FQI326oZFsNBfWFI3TuncVaMd9n5d7rBtvztTS8NEOw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)