UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mb+YO0HiOb/8dJPNdcjKhnsl0jYIlOdbXDGuhYd0nVw=' 
WHERE 
  key_id = '9b943d946ecda299ca41ad33d3a90ff43f5176d1dbf6f2832891324445ec7958' 
  AND (
    token = 'Mb+YO0HiOb/8dJPNdcjKhnsl0jYIlOdbXDGuhYd0nVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028