UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x2lOKNY5jp46EUt0tPSWEr9ackcOsWXPbTLJeo9hvSU=' 
WHERE 
  key_id = '8795e40f31f9d83e2479392ca150866f5c4e1be4611b0e7c934de0fc8090b9a7' 
  AND (
    token = 'x2lOKNY5jp46EUt0tPSWEr9ackcOsWXPbTLJeo9hvSU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023