UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '97HyE4Yq1DvztiZ5MKbXwpCm4wXPVv0r0qeczi/kWxY=' 
WHERE 
  key_id = '74aa462019ec15c7be5125afe6acc11fae4aa365d53bdda6424d2006ae0207c8' 
  AND (
    token = '97HyE4Yq1DvztiZ5MKbXwpCm4wXPVv0r0qeczi/kWxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044