UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's3yXuLl8vOQD1Rj+lbeOuqUGxliZTTiY1N2mSkJu7iA=' 
WHERE 
  key_id = 'faa0e8e416856bba477109a9e79d346abf66fe147533c18c3d430f0dc3cb66ea' 
  AND (
    token = 's3yXuLl8vOQD1Rj+lbeOuqUGxliZTTiY1N2mSkJu7iA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029