UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lk3mGPRl24zLHlHTIEhAAGhaXFjYqXyCGrnxt7KPCnc=' 
WHERE 
  key_id = 'dcf9ec1f9415237e96ae5f7385eba419e3b05ba12bd4a24e2b1caa6a4773247b' 
  AND (
    token = 'lk3mGPRl24zLHlHTIEhAAGhaXFjYqXyCGrnxt7KPCnc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021