UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qzxjWD26llZUHv6oHqq+H0Lp/IXgC6gLFoNaXpVyN2g=' 
WHERE 
  key_id = 'aa079e8b527b12d7f6669cce661c271cb9e2878ddd9efe89bcb582ac220ae21d' 
  AND (
    token = 'qzxjWD26llZUHv6oHqq+H0Lp/IXgC6gLFoNaXpVyN2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040