UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7m9CnbUbOCf/JPOpVdRyPLY0s2SuseV7vU2N6qOjqzY=' 
WHERE 
  key_id = '119444fe72e5a663b5aa602c27deb4bc2dcbba4c889b290cf67d4b431fbd97bd' 
  AND (
    token = '7m9CnbUbOCf/JPOpVdRyPLY0s2SuseV7vU2N6qOjqzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045