UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/wbvSvyhbkq7Sqn3BFcR4Rc1G0+Ef8+MU100Gs4hPn4=' 
WHERE 
  key_id = '3db371e427bdf875c73a2800a0a915298e8628b8ed2690cf905cf46b99540acf' 
  AND (
    token = '/wbvSvyhbkq7Sqn3BFcR4Rc1G0+Ef8+MU100Gs4hPn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016