UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dCdM/MOLXU79EJKCkWYw8aPj52dGDGd0TO+viEVtvxc=' 
WHERE 
  key_id = 'ce3feaad0f3689557c4120d82662fdc40fc0b119024b2fd684bc47b22877bbc7' 
  AND (
    token = 'dCdM/MOLXU79EJKCkWYw8aPj52dGDGd0TO+viEVtvxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022