UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9eF/pyaOdYTQTsO3J9igDrYAxdQtuLc1lzI9ACkpqvw='
WHERE
key_id = '782e5a726a1c31ea27dde8aeb9d8dc3dd0cfe66d7621230b4a838225a708df81'
AND (
token = '9eF/pyaOdYTQTsO3J9igDrYAxdQtuLc1lzI9ACkpqvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)