UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TWgsGyiEpEsgZ2j/jeGYuLB0bxSnmjeXKUp+VigdmeU=' 
WHERE 
  key_id = '4e351648ea08eda5a240e435dab2ea2db7de8d03d4eacee8fb810352da76e122' 
  AND (
    token = 'TWgsGyiEpEsgZ2j/jeGYuLB0bxSnmjeXKUp+VigdmeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033