UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pix9rBd80oyMt372BMq4/kurCZs2nzZofFHvJEEqkJ4='
WHERE
key_id = 'b18f8ebc85eec3ce66d0c261b6d010e0a88a4432917465fc7e5f181ae9e9b193'
AND (
token = 'Pix9rBd80oyMt372BMq4/kurCZs2nzZofFHvJEEqkJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)