UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rjk0pQaaeCgHpeZ6J7gjJEGax5+ka0WEm9OUvBLx9jI=' 
WHERE 
  key_id = 'eeda80399cd4d7aedd91555175104b4d4480cf977bef47477a4b1e4e2ee64399' 
  AND (
    token = 'Rjk0pQaaeCgHpeZ6J7gjJEGax5+ka0WEm9OUvBLx9jI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043