UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QpU/Q6zuov6Ys+lL8Nm8yU+jY7Pys0Dc+rFHT6M10ZU=' 
WHERE 
  key_id = '3197d5d20ea1528d07282e6dcf20b42f6d1774d0708686772e4a51c397c6b607' 
  AND (
    token = 'QpU/Q6zuov6Ys+lL8Nm8yU+jY7Pys0Dc+rFHT6M10ZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034