UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'du1GeOlOGjJjbXYKLw4zssf7ERMjYUexe9DgXfjjEP4=' 
WHERE 
  key_id = '3a7371cce1c00ed3db81fb9148bb9890fe847fb70b5a86fc0f49df62de554cba' 
  AND (
    token = 'du1GeOlOGjJjbXYKLw4zssf7ERMjYUexe9DgXfjjEP4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016