UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tJQrC72GziRTu7Ukd2SD+dXVUxaCkre2hragNIzqE2E=' 
WHERE 
  key_id = 'e06444993c96966ea6253c6381be9000e596e6f10451afdfd4b82a1b281474e9' 
  AND (
    token = 'tJQrC72GziRTu7Ukd2SD+dXVUxaCkre2hragNIzqE2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035