UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pdcAxEpvVUYVyXOjbHJ2iApe4dRTLxjmWu+o9zVpJUU=' 
WHERE 
  key_id = 'a1c0442d228a1ba655cd029677c0a472c86afb3b1a1a50225e4e3a9d9f1eeb36' 
  AND (
    token = 'pdcAxEpvVUYVyXOjbHJ2iApe4dRTLxjmWu+o9zVpJUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034