UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YFOWUYo/qvjpTigRkLk5+PE9hZufbj+s2wISsVZKqkk=' 
WHERE 
  key_id = '3112a10655fea20074b5e83dd63507a67af368e1b945164b5f87bba0dfad691b' 
  AND (
    token = 'YFOWUYo/qvjpTigRkLk5+PE9hZufbj+s2wISsVZKqkk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015