UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Vih0T3BDvAuNOiUCPv1VO8IQ2EPji7pm4a6A1OB2+s=' 
WHERE 
  key_id = '23bcdd59540e157edfe2da86d12bdc2864a1be714e0eb92fce09f934c6292a8a' 
  AND (
    token = '5Vih0T3BDvAuNOiUCPv1VO8IQ2EPji7pm4a6A1OB2+s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040