UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tMxfVPeLmXXf3EPxWZtypbcGAGUG7ax8k/M0GIH5WXs=' 
WHERE 
  key_id = '3796fbbcf9cab9bd0a84884ad63282121f5aee26cd53e7ed65fccebfb81b80ba' 
  AND (
    token = 'tMxfVPeLmXXf3EPxWZtypbcGAGUG7ax8k/M0GIH5WXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031