UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cRxu2LfJVpHl0Z5e618E31c2YtbBMAHadBWOLm9U5IQ=' 
WHERE 
  key_id = 'f927f550979570f47796f16da4f6fb9ed5b4e45b13ef3c6a04872976c6d29d8f' 
  AND (
    token = 'cRxu2LfJVpHl0Z5e618E31c2YtbBMAHadBWOLm9U5IQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021