UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O9pbJw+qyqMpQtPwhusso0Htqz9GutUhANiHFa5BUMQ=' 
WHERE 
  key_id = '9208e7c768230292e654eacd2c25a2ab49054b73707ed5a564445ee12ca43ccb' 
  AND (
    token = 'O9pbJw+qyqMpQtPwhusso0Htqz9GutUhANiHFa5BUMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033